package cn.haocxy.jfm.util;

import java.util.Scanner;
import java.util.function.Consumer;

/**
 * @author 蔡心宇
 *
 */
public final class Test {

	private Test() {
	}
	
	public static void forEachCmdLine(Consumer<String> action) {
		if (action != null) {
			Scanner stdin = new Scanner(System.in);
			while (stdin.hasNextLine()) {
				action.accept(stdin.nextLine());
			}
			stdin.close();
		}
	}
	
	public static void tln(Object s) {
		System.out.println(s);
	}
	
	public static void ttrace(Exception e) {
		e.printStackTrace();
	}
	
	// 打印调用tfunc方法的方法的名称
	public static void tfunc() {
		System.out.println(Thread.currentThread().getStackTrace()[2].getMethodName() + "(...)");
	}
}
